package org.zturn.exhibition.encrypt;
 
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
import javax.servlet.Filter;
 
/**
 * @ClassName : WebAllHandlerConfig
 * @Description : 过滤器、监听器、拦截器 前置处理配置类
 * @Author : AD
 */
@Configuration
public class WebAllHandlerConfig{
 
    /**
     * 注册过滤器
     * */
    @Bean
    public FilterRegistrationBean AllFilterRegistration(){
        FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
        registration.setFilter(decryptReplaceStreamFilter());
        registration.addUrlPatterns("/*");
        registration.setName("APISecurityFilter");
        registration.setOrder(1);
        return registration;
    }
 
    @Bean(name = "decryptReplaceStreamFilter")
    public Filter decryptReplaceStreamFilter(){
        return new DecryptReplaceStreamFilter();
    }
 
 
}